{% extends "agm1.0/base.html" %}
{%- block body %}
        {% if g.wxauthurl %}<script>location.href="{{g.wxauthurl|safe}}"</script>{% endif %}
        <section id="postsid" wechatsignused data-role="page" data-add-back-btn="true" data-bak-pid="{{item.id}}"{% if item.get('sharetype') == g.taglabel %} wx-des="音速风暴 晒照片,送红包"{% endif %}>
            <header data-role="header" data-position="fixed">               
                <h3>{{item.get('title')}}</h3>
            </header>  
                <div class="head_pic"><img src="/static/images/tu1.jpg"></div>
                <div class='wx_logo' style='display:none;'><img src="{{item.get('imgurls')[0]}}"/></div>                 
            <div data-role="content">
                <div class="author width100px"><img src="{{item.get('headimgurl') or '/static/images/getheadimg.png'}}"/><div class="posit"><strong>{{item.get('author')}}</strong></div></div>
                <div class="poststate">{% if item.get('sharetype') == g.taglabel %}投票{% else %}点赞{% endif %}数:<span class="likecount">{{item.get('likecount') or 0}}</span> 浏览:<span class="viewcount">{{item.get('viewcount')}}</span> 评论:<span class="commentcount">{{len(item.get('comments'))}}</span></div><hr/>
                <div class="postcontent">
                    <div class="postimages">
                    {% for i, imgurl in enumerate(item.get('imgurls')) %}
                    {% if item.get('imgdecs')%}<div class="imgdec ui-bar-a">{{item.get('imgdecs')[i]}}</div>{% endif %}
                    <img class="decimgsrc" src="{{imgurl|replace('ac-m3vGPBDT.clouddn.com', 'lc-m3vgpbdt.cn-n1.lcfile.com')}}"/>
                    {% endfor %}</div>
                    <p>{{item.get('content')}}</p>
                    {% if request.headers.get('User-Agent') and 'MicroMessenger/' in request.headers.get('User-Agent') and item.get('sharetype') == g.taglabel %}
                    <div class="sharewx" style="text-align:right;">
                        <a data-inline="true" data-role="button" data-mini="true" data-corners="false"><img src="/static/images/icon_msg.png" style="width:17px">发送给朋友</a>
                        <a data-inline="true" data-role="button" data-mini="true" data-corners="false"><img src="/static/images/icon_timeline.png" style="width:17px">分享到朋友圈</a>
                    </div>
                    <div class="weixin-tip2">
                        <p><img src="/static/images/guide.png" alt="微信打开"/></p>
                    </div>                    
                    {% endif %}
                    <div class="reply">
                        <div class="posttime">{{item.created_at.strftime('%Y-%m-%d %H:%M')}}</div>
                        <div class="mylike">
                        <div class="getlike heart"></div><div class="likeCount">{{item.get('likecount') or 0}}</div><div class="liketext">{% if item.get('sharetype') == g.taglabel %}投票{% else %}点赞{% endif %}</div></div>
                        <div class="getcomment"><a href="#">评论</a></div>
                    </div>
                    <hr/>
                    <div class="c_items">
                    {% for comment in item.get('comments') %}
                        <div class="c_item">
                        <div class="author">
                        <img src="{{comment.get('headimgurl') or '/static/images/getheadimg.png'}}"/><div><strong>{{comment.get('author')}}</strong></div>
                        </div>
                        <div class="c_item_content">{{comment.get('c_content')}}</div>
                        
                        <div class="c_item_date">{% if session.get('wechatrole') == 'agmadmin'%}<div><a c_pid="{{comment.id}}" class="c_delbtn" href="#">删除</a></div>{% endif %}{{ comment.created_at.strftime('%Y-%m-%d %H:%M')}}</div>
                        <hr/>
                        </div>
                    {% endfor %}                    
                    </div>
                    <form class="commentarea">
                    <textarea name="c_content" class="comment" placeholder="评论内容"></textarea>
                    <div class="commentit">
                        <a href="#" class="cancelcomment"data-inline="true" data-mini="true">取消</a>
                        <a href="#" class="postcomment" data-role="button" data-inline="true" data-corners="false" data-mini="true" data-theme="b">评论</a>
                    </div>
                    </form>
                </div>
            </div>
            <footer data-role="footer" data-position="fixed"><h3><small>©2020 {{_t('AGM 英宝玩具', 'Top-Racer')}}</small></h3></footer>
        </section>
    {% endblock %}